package com.flow.dao.impl;

import java.util.ArrayList;
import java.util.List;
import com.flow.dao.IUserBasicDao;
import com.flow.model.PagerModel;
import com.flow.model.UserBasic;

/**
 * 会员基本信息Dao层
 * @author wang
 * @2015-12-5
 * UserBasicDaoImpl.java
 * @param <T>
 *
 */
public class UserBasicDao<T> extends BaseDao<T> implements IUserBasicDao<T>  {

	@Override
	public boolean insertUserBasic(UserBasic userBasic) {

		try {

			insert(userBasic);
			return true;

		} catch (Exception e) {

			e.printStackTrace();

		}

		return false;
		
	}

	@Override
	public boolean updateUserBasic(UserBasic userBasic) {
		
		try {

			update(userBasic);
			return true;

		} catch (Exception e) {

			e.printStackTrace();

		}
		
		return false;
		
	}

	@Override
	public boolean deleteUserBasic(UserBasic userBasic) {
		
		try {

			delete(userBasic);
			return true;

		} catch (Exception e) {

			e.printStackTrace();

		}
		
		return false;
		
	}

	@Override
	public UserBasic findUserBasicByHql(String hql) {

		return findUserBasicByHql(hql, null);
		
	}

	@Override
	public UserBasic findUserBasicByHql(String hql, Object param) {

		List<Object> params  = new ArrayList<Object>();
		params.add(param);
		return findUserBasicByHql(hql, params);
		
	}

	@Override
	public UserBasic findUserBasicByHql(String hql,
			List<Object> params) {
		
		return (UserBasic) findByHql(hql, params);
		
	}

	@Override
	public int universalMethodUserBasic(String hql) {

		return universalMethodUserBasic(hql, null);
		
	}

	@Override
	public int universalMethodUserBasic(String hql, Object param) {

		List<Object> params  = new ArrayList<Object>();
		params.add(param);
		return universalMethodUserBasic(hql, params);
		
	}

	@Override
	public int universalMethodUserBasic(String hql, List<Object> params) {

		return universalMethod(hql, params);
		
	}

	@Override
	public List<T> findUserBasicAllByHql(String hql) {

		return findUserBasicAllByHql(hql, null);
		
	}

	@Override
	public List<T> findUserBasicAllByHql(String hql, Object param) {

		List<Object> params  = new ArrayList<Object>();
		params.add(param);
		return findUserBasicAllByHql(hql, params);
		
	}

	@Override
	public List<T> findUserBasicAllByHql(String hql, List<Object> params) {

		return findAllByHql(hql, params);
		
	}

	@Override
	public PagerModel findUserBasicPagerModeled(PagerModel pager, String hql) {
		
		return findUserBasicPagerModeled(pager, hql, null);
		
	}

	@Override
	public PagerModel findUserBasicPagerModeled(PagerModel pager, String hql, Object param) {
		
		List<Object> params  = new ArrayList<Object>();
		params.add(param);
		return findUserBasicPagerModeled(pager, hql, params);
		
	}

	@Override
	public PagerModel findUserBasicPagerModeled(PagerModel pager, String hql, List<Object> params) {

		return findPagerModeled(pager, hql, params);
		
	}

}
